package com.kangtu.demoweixpay.service.impl;

import com.kangtu.demoweixpay.service.ITbUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @Author david
 * @Date 2021/4/19 18:38
 * @Copyright 康途慧智（北京）科技发展有限公司
 * @Version V1.0.0
 */

@Slf4j
@Service
public class TbUserServiceImpl implements ITbUserService {
    @Override
    public String get() {
        return "index";
    }

    @Override
    public String add(String userName, String userPass) throws Exception {
        if (userName == null) {
            log.error("userName is null");
            throw new Exception("userName is null");
        }
        if (userPass == null) {
            log.error("userName is null");
            throw new Exception("userName is null");
        }
        return "add:"+userName+","+userPass;
    }

    @Override
    public String del(Integer userId) throws Exception {
        if (userId.equals(0)) {
            log.error("userName is null");
            throw new Exception("userId is 0");
        }
        return "del:"+userId;
    }

    @Override
    public String set(String userName, String userPass) {
        return "set:"+userName+","+userPass;
    }

}
